<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function add(m,n){  //加法函数
            return m+n;
        }
        function calc(fun,m,n){  //fun是一个函数的引用
            console.log('运算结果是：'+fun(m,n));
        }
        calc(add,100,200);  //命名函数作参数
        calc(function(m,n){return m-n;},300,400);  //匿名函数作参数
        calc((x,y)=>x*y,500,600);  //箭头函数当作参数

    </script>
</body>
</html>